package com.six.shop.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.six.core.entity.Shop;
import com.six.core.vo.Result;
import com.six.core.vo.ShopAndUserVo;
import com.six.shop.dao.ShopDao;
import com.six.shop.service.ShopService;
import com.six.shop.vo.SearchCheckShop;
import com.six.shop.vo.SearchShop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName:ShopController
 * Description:
 * date:2023/2/27 10:13
 *
 * @since JDK 1.8
 */
@RestController
@RequestMapping("shop/shop")
public class ShopController {
    @Autowired
    private ShopService shopService;

    @GetMapping("findAll")
    public Result findAll(@RequestBody SearchShop shop, @RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "5")Integer pageSize){
       return shopService.findAll(shop,currentPage,pageSize);
    }
    @PostMapping("updateStateTrue")
    public Result updateStateTrue(Integer shopid){
        return shopService.UpdateStateTrue(shopid);
    }
    @PostMapping("updateStateStart")
    public Result updateStateStart(Integer shopid){
        return shopService.UpdateStateStart(shopid);
    }
    @PostMapping("updateStateFales")
    public Result updateStateFales(@RequestBody Shop shop){
        return shopService.UpdateStateFales(shop);
    }
    @PostMapping("findAllByNum")
    public Integer findAllByNum( ){
        return shopService.findAllByNum();
    }
    @PostMapping("findShopAndPrice")
    public List<ShopAndUserVo> findShopAndPrice(){
        return shopService.findShopAndPrice();
    }

}
